<template>
  <div class="home">  
          
           <div class="box1">

               <div>
                   <van-field v-model="params.title" label="标题" placeholder="请输入标题" />

               </div>   
               <div>
                   <!-- 输入手机号，调起手机号键盘 -->
                        <van-field v-model="params.phone" type="tel" label="手机号" maxlength="11"  placeholder="请输入手机号" />
               </div>
                           <div>
                                <van-field
                                v-model="params.desc"
                                rows="5"
                                autosize
                                label="留言"
                                type="textarea"
                                placeholder="请输入留言"
                                />
                           </div>
           </div>
           <div class="buts">
               <van-button  @click="sub">提交</van-button>
           </div>
           
  </div>
</template>
<script>
import {hideWxMenu } from '@/assets/js/tools'
import QRCode from 'qrcodejs2'
let t;
export default {
  name: 'home',
    data() {
    return {
        params:{
          openid:localStorage.getItem('openid'),
          title:'',
          phone:'',
          desc:'',
        }

      
    }
    },
  mounted(){
       t=this;
       
     hideWxMenu()
   },
  methods:{
    sub(){
         for(let key in this.params){
                      if(!this.params[key])
                      return  t.$toast('请填写完整后再进行提交');
          }
        t['$API']['homeOopinion'](t.params).then(res=>{
              if(res.code==200){
                t.$toast(res.msg);
              }
        })
    },
    linkTo(url){
          this.$router.push({name:url})  
    },

  },
}
</script>
<style scoped lang="less">
.home{
  height: 100vh;
    background: #ededed;
} 

.box1{
    background-color: white;
  
}
 .buts{
      display: flex;
      position: fixed;
      bottom: 1rem;
      width: 100%;
      justify-content: center;
      >button{
          width: 90%;
           background: #376157;
    background-image: linear-gradient(45deg, #376157, #00b894);
          color: white;
      }
  }
</style>
 